import dsqMainRequest from './request';
import { BASE_URL as baseURL, TIME_OUT as timeout } from './request/config';
import localCache from '@/utils/localCache';
const dsqRequest = new dsqMainRequest({
  baseURL,
  timeout,
  interceptors: {
    requestInterceptor(config) {
      // console.log('请求成功的拦截');
      const token = localCache.getCache('token');
      if (token) {
        config.headers!.Authorization = `Bearer ${token}`;
      }
      return config;
    },
    responseInterceptor(res) {
      // console.log('响应成功的拦截');
      return res;
    }
  },
  //指示是否显示loading
  showLoading: true
});
export { dsqRequest };
